import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { HomeComponent } from './home.component';
import { PersonalDataComponent } from '../personal-data';
import { UserListComponent, UserProfileComponent } from '../user-manager';
import { TeacherListComponent, TeacherAddComponent } from '../teacher-manager';
import { CourseListComponent, CourseAddComponent, CourseCategoryComponent, CourseTopicComponent } from '../course-manage';

const routes: Routes = [
  { path: 'home', component: HomeComponent,
    children: [
        {
            path: '',
            redirectTo: 'personal-data',
            pathMatch: 'full'
        },
        {
            path: 'personal-data',
            component: PersonalDataComponent,
        },
        {
            path: 'user-list',
            component: UserListComponent,
        },
        {
            path: 'user-profile',
            component: UserProfileComponent,
        },
        {
            path: 'teacher-list',
            component: TeacherListComponent,
        },
        {
            path: 'teacher-add',
            component: TeacherAddComponent,
        },
        {
            path: 'course-add',
            component: CourseAddComponent,
        },
        {
            path: 'course-list',
            component: CourseListComponent,
        },
        {
            path: 'course-category',
            component: CourseCategoryComponent,
        },
        {
            path: 'course-topic',
            component: CourseTopicComponent,
        },
    ]
  },
]

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule ]
})
export class HomeRoutingModule {}
